import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import fire from '@dfeidao/atom-web/msg/fire';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import hide from '@dfeidao/atom-web/ui/hide';

export default async function a009(fd: IFeidaoAiBrowserComponent,e: Event) {
	// todo
	hide(fd.data.node);
	const n=e.currentTarget as HTMLLIElement;
	const arr=n.getAttribute('data-no');
	const res=await nodejs<{dt: Array<{topic_type: string}>}>('question-bank/zj-000001/s004',{
		filter:{
			topic_type:arr
		}
	});
	let a="";
	for (let c=0;c < res.dt.length;c++) {
		a += res.dt[c].topic_type;
	 }
	if (a === "多选题") {
		fire('zj-000007','a002',arr);

	} else if (a === "单选题") {
		fire('zj-000007','a001',arr);

	} else {
		fire('zj-000008','a001',arr);
	}
}
